import QtQuick 2.0

// UnitMenu element, used as unit's context menu

Rectangle {
    id: unitMenu
    property int ownerIndex: 0

    x: parent.width / 2
    y: parent.height / 2
    width: 65
    height: 87
    border.width: 1
    radius: 3
    border.color: "black"
    color: "lightgrey"
    visible: false;

    signal showMoves;
    signal showThrows;
    signal showSpecials;

    Column{
        id: menuColumn
        anchors.fill: parent
        spacing: 1
        anchors.margins: 2

        UnitMenuItem {
            id: menuMmove
            text: "Move"
            onClicked: {
                unitMenu.visible = false
                showMoves()
            }
        }
        UnitMenuItem {
            id: menuThrow
            text: "Throw"
            onClicked: {
                unitMenu.visible = false
                showThrows()
            }
        }
        UnitMenuItem {
            id: menuSpecial
            text: "Specials"
            onClicked: {
                unitMenu.visible = false
                showSpecials()
            }
        }
        UnitMenuItem {
            id: menuCancel
            text: "Cancel"
            onClicked: {
                unitMenu.visible = false
            }
        }
    }
}
